/**
 * @file interface/enum
 * @author  fanxl
 */

/** dataType 属性值枚举 */
export const DatatypeEnum = {
    STRING: 'STRING',
    COLOR: 'COLOR',
    BOOL: 'BOOL',
    NUMBER: 'NUMBER',
    ENUM: 'ENUM',
    UPLOAD: 'UPLOAD',
    VIDEO: 'VIDEO',
    AUDIO: 'AUDIO',
    HTML: 'HTML',
    URL: 'URL',
    OBJECT: 'OBJECT',
    LIST: 'LIST',
    ALTERNATIVE: 'ALTERNATIVE',
    // ACTIONLINK 配置专用，不会出现在最终spec里
    OWNACTIONLINK: 'OWNACTIONLINK'
};

export type DatatypeEnumType = (typeof DatatypeEnum)[keyof typeof DatatypeEnum];

/** ui 属性值枚举 */
export const UiEnum = {
    Input: 'Input', // string
    Textarea: 'Textarea', // string
    SearchBox: 'SearchBox', // string
    RadioButtonGroup: 'RadioButtonGroup', // string
    Color: 'Color', // string
    Uploader: 'Uploader', // string
    VideoUploader: 'VideoUploader', // string
    AudioUploader: 'AudioUploader', // string
    RichText: 'RichText', // string
    Select: 'Select', // object
    EnumSelect: 'EnumSelect', // string
    NumberInput: 'NumberInput', // number
    Checkbox: 'Checkbox', // boolean
    Switch: 'Switch', // boolean
    Block: 'Block', // object
    List: 'List', // list
    Tabs: 'Tabs', //
    DatePicker: 'DatePicker',
    Autocomplete: 'Autocomplete',
    CheckboxGroup: 'CheckboxGroup'
};

export type UiEnumType = (typeof UiEnum)[keyof typeof UiEnum];

/** 文件类型 枚举 */
export const FileTypeEnum = {
    IMAGE: 'IMAGE',
    FLASH: 'FLASH',
    FLV: 'FLV',
    MISC: 'MISC',
    VIDEO: 'VIDEO'
};

export type FileTypeEnumType = (typeof FileTypeEnum)[keyof typeof FileTypeEnum];

export const EditorToolsEnum = {
    link: 'link',
    emphasize: 'emphasize'
};

export type EditorToolsEnumType = (typeof EditorToolsEnum)[keyof typeof EditorToolsEnum];

/** 表达式配置的逻辑操作枚举 */
export const ExpressionLogicOpEnum = {
    NULL: '-1',
    OR: '0',
    AND: '1'
};

export type ExpressionLogicOpEnumType = (typeof ExpressionLogicOpEnum)[keyof typeof ExpressionLogicOpEnum];

/** 表达式的比较操作符枚举 */
export const ExpressionOperation = {
    LT: '<',
    GT: '>',
    LTOREQUAL: '<=',
    GTOREQUAL: '>=',
    EQUAL: '==',
    NOT_EQUAL: '!=',
    INCLUDES: 'includes',
    NOT_INCLUDES: 'not_includes',
    BOOLEAN_TRUE: 'true',
    BOOLEAN_FALSE: 'false',
    EMPTY: 'empty',
    LENGTH: 'length'
};

export type ExpressionOperationType = (typeof ExpressionOperation)[keyof typeof ExpressionOperation];
